1 . Field of the Invention
The invention relates to a method for storing and propagating error information in computer programs.
2 . Description of the Related Art
In safety-oriented programs for industrial applications, that are typically executed on embedded hardware, such as programmable logic controllers (PLCs) including a processor or other type of computational unit, it is necessary to ensure that the error information spotted during program execution is safely retained up to the end of the program run or up to the end of a cycle so that the routines for error reactions that are executed at the end of the program run or cycle are initiated with certainty. The storage and retention of the error information up to the end of the program is referred to generally as error propagation.
Important variables are processed in coded form in the safety-oriented programs, where this process is also called “coded processing”. To this end, values (xf) are coded in variables via AN, ANB (AN+B), ANBD codes or by related codes (hybrid method). In this case, all numerical variables are coded on the basis of a rule in the formxc=A*xf+B_x+D,  Eq. (1)
and the arithmetic operations (+, −, *, /, etc.) are customized such that the processing in the coded range (xc) delivers consistent results for the Ur range (xf) (in this case, it is entirely possible for B_x or D also to have the value zero).
The coded variable can be used to detect errors arise as a result of a random change or corruption of individual bits, for example. This means that the values to be coded are mapped onto coded values such that a discrepancy in individual bits can be recognized by virtue of errors in individual bits allowing the production of invalid values in the coded space, for example, on account of the Hamming distance between admissible coded values. Here, it is also possible for double storage and processing of the values, i.e., once in coded form and once in uncoded form, to occur, with the respective verification involving the value being extracted from the coded variable and being compared with the value managed in uncoded form.
A program run is verified in the conventional systems by using run variables, known as “tracers”, the content of which can be used to log and hence check the program path taken.
Thus, while numerous known approaches exist for the recognition of errors, the failsafe formation of an error variable and the propagation thereof are not trivial. By way of example, there is no possibility of adding a constant to an error variable, etc., for every error or alternatively in every case of nonerror because such standard steps can be optimized, i.e., combined, for example, by compilers, which reduces the certainty.